package springboot01.demo.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class TestController01 {
    @Value("${person.name}")
    private String name;

    @Value("${person.age}")
    private int age;
   @RequestMapping(value="/springboot/test01")
    public @ResponseBody String test01(){
        return "Hello SpringBoot!";
    }

    @RequestMapping(value="/springboot/mapvalue")
    public @ResponseBody Map<String,Object> mapvalue(){
       Map<String,Object> retMap=new HashMap<String,Object>();
       retMap.put("message","SpringBoot Project");
       return retMap;
    }

    @RequestMapping(value = "/say")
    public @ResponseBody String say(){

       return name+" "+age;
    }
}
